Skip to content

Comments

feat: shareable URL support for hand calculator#18

Merged
rysb-dev merged 2 commits intomainfrom
feat/shareable-url
Feb 14, 2026
Merged

feat: shareable URL support for hand calculator#18
rysb-dev merged 2 commits intomainfrom
feat/shareable-url

Conversation

@rysb-dev
Copy link
Owner

Add the ability to share calculator state via URL.

Clicking Share encodes the current hand, melds, dora indicators, and context options into query parameters using agari-core terminal input syntax (e.g. ?h=123m456p789s11z(111m)&w=2m&d=1m,5z&ri&t). The link is copied to the clipboard.

Opening a shared URL auto-populates the UI and runs score calculation automatically if the hand is complete.

Changes

  • New urlState.ts module with serialize/deserialize and hand notation parser
  • Share button in the hand builder header (copies link to clipboard)
  • URL restore on page load in onMount
  • Auto-calculate score when loading a complete hand from URL
  • Clear button strips query params from the address bar
  • i18n support (en/ja) for share UI strings

Encode calculator state (hand, melds, dora, context options) into URL
query parameters using agari-core terminal input syntax. Opening a
shared link auto-populates the UI and calculates the score.

- Add urlState.ts with serialize/deserialize and hand notation parser
- Add Share button next to Clear that copies link to clipboard
- Auto-run score calculation when loading a complete hand from URL
- Clear button strips query params from address bar
- i18n support for share UI strings (en/ja)
The publish-crates-io job was manually added to the autogenerated
release.yml, causing dist plan --check to fail.

Move it to a reusable workflow (.github/workflows/publish-crates-io.yml)
and reference it in dist-workspace.toml as a custom publish job. This
lets cargo-dist manage release.yml while still publishing to crates.io.
@rysb-dev rysb-dev self-assigned this Feb 14, 2026
@rysb-dev rysb-dev merged commit 265db83 into main Feb 14, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant